Skip to content

feat: add Q7 zone cleaning - #1038

Open
ramon-angosto wants to merge 1 commit into
Python-roborock:mainfrom
ramon-angosto:q7/1-zone-cleaning
Open

ramon-angosto wants to merge 1 commit into
Python-roborock:mainfrom
ramon-angosto:q7/1-zone-cleaning

Conversation

@ramon-angosto

Copy link
Copy Markdown

Summary

Adds zone cleaning to the Q7 (B01) properties API:

  • Q7PropertiesApi.clean_zone(first_corner, second_corner) cleans one rectangle.
  • Q7PropertiesApi.clean_zones([(first, second), ...]) cleans several rectangles in a single task.
  • New Q7RoborockPoint (common Roborock millimetre coordinates, map origin at (25500, 25500)) with from_world() / to_world() conversions to the Q7 world coordinates (meters, origin next to the dock, y pointing up). This keeps the public API in the same coordinate space as other Roborock devices.

Device protocol

The device needs three commands, in this order:

  1. service.set_preference_type {"prefer_type": 4} selects zone cleaning.
  2. service.set_zone_points {"zone_points": [x1, y1, x2, y1, x2, y2, x1, y2, ...]} sends the corners of each rectangle in world meters. Multiple rectangles are concatenated.
  3. service.set_zone_clean {"ctrl_value": 1} starts the task. ctrl_value: 0 stops it.

While the zone task runs, the device reports work_mode 30 (PLAN_AREA).

Testing

  • Unit tests cover coordinate conversion, single and multiple zones, and rejection of empty or zero-area zones.
  • Verified on a Q7 TF+ (roborock.vacuum.sc05, firmware 03.01.80) with one and two zones.

Add `clean_zone` and `clean_zones` to the Q7 properties API. Zones are given
as two opposite corners in the common Roborock millimetre coordinate space
through a new `Q7RoborockPoint`, which converts to and from the Q7 world
coordinates (meters, origin next to the dock).

The device expects the zone preference type to be selected first
(`service.set_preference_type`), then the zone corners as a flat list
(`service.set_zone_points`), and finally `service.set_zone_clean` to start.
Several zones are concatenated into a single task.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant